package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class NoteDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("note.txt",true);
        Scanner s = new Scanner(System.in);
        String s1;
        byte[] b;
        System.out.println("请开始输入：");
        while (!("exit".equals(s1=s.next()))) {
           b = s1.getBytes(StandardCharsets.UTF_8);
           fos.write(b);
       }
        System.out.println("再见");
        fos.close();
    }
}
